package com.link2room.rodimus.entity;

import com.link2room.common.entity.BaseEntity;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * Created by LN on 2017/7/28.8:28
 */
@Entity
@Table(name = "coupon_consume_base")
public class CouponConsumeBaseEntity extends BaseEntity {
    private String couponCode;
    private String consumeNo;
    private String goodCode;
    private String sta;
    private String memberNo;
    private String openid;
    private Integer amount;
    private String goodName;

    @Basic
    @Column(name = "good_name")
    public String getGoodName() {
        return goodName;
    }

    public void setGoodName(String goodName) {
        this.goodName = goodName;
    }
    @Basic
    @Column(name = "coupon_code")
    public String getCouponCode() {
        return couponCode;
    }

    public void setCouponCode(String couponCode) {
        this.couponCode = couponCode;
    }

    @Basic
    @Column(name = "consume_no")
    public String getConsumeNo() {
        return consumeNo;
    }

    public void setConsumeNo(String consumeNo) {
        this.consumeNo = consumeNo;
    }

    @Basic
    @Column(name = "good_code")
    public String getGoodCode() {
        return goodCode;
    }

    public void setGoodCode(String goodCode) {
        this.goodCode = goodCode;
    }

    @Basic
    @Column(name = "sta")
    public String getSta() {
        return sta;
    }

    public void setSta(String sta) {
        this.sta = sta;
    }

    @Basic
    @Column(name = "member_no")
    public String getMemberNo() {
        return memberNo;
    }

    public void setMemberNo(String memberNo) {
        this.memberNo = memberNo;
    }

    @Basic
    @Column(name = "amount")
    public Integer getAmount() {
        return amount;
    }

    public void setAmount(Integer amount) {
        this.amount = amount;
    }



    @Basic
    @Column(name = "openid")
    public String getOpenid() {
        return openid;
    }

    public void setOpenid(String openid) {
        this.openid = openid;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        CouponConsumeBaseEntity entity = (CouponConsumeBaseEntity) o;

        if (couponCode != null ? !couponCode.equals(entity.couponCode) : entity.couponCode != null) return false;
        if (consumeNo != null ? !consumeNo.equals(entity.consumeNo) : entity.consumeNo != null) return false;
        if (goodCode != null ? !goodCode.equals(entity.goodCode) : entity.goodCode != null) return false;
        if (sta != null ? !sta.equals(entity.sta) : entity.sta != null) return false;
        if (memberNo != null ? !memberNo.equals(entity.memberNo) : entity.memberNo != null) return false;
        if (openid != null ? !openid.equals(entity.openid) : entity.openid != null) return false;
        if (amount != null ? !amount.equals(entity.amount) : entity.amount != null) return false;
        return goodName != null ? goodName.equals(entity.goodName) : entity.goodName == null;
    }

    @Override
    public int hashCode() {
        int result = couponCode != null ? couponCode.hashCode() : 0;
        result = 31 * result + (consumeNo != null ? consumeNo.hashCode() : 0);
        result = 31 * result + (goodCode != null ? goodCode.hashCode() : 0);
        result = 31 * result + (sta != null ? sta.hashCode() : 0);
        result = 31 * result + (memberNo != null ? memberNo.hashCode() : 0);
        result = 31 * result + (openid != null ? openid.hashCode() : 0);
        result = 31 * result + (amount != null ? amount.hashCode() : 0);
        result = 31 * result + (goodName != null ? goodName.hashCode() : 0);
        return result;
    }
}
